package com.mobile.controller;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.hsnn.medstgmini.Constants;
import com.hsnn.medstgmini.sys.model.SysUser;
import com.hsnn.medstgmini.sys.service.SysUserManager;

/**
 * @category 手机九宫格首页
 * @author 单大伟
 * @date 2015-06-10
 */

@Controller
public class MobileIndexController {

	private static final Logger log = Logger.getLogger(MobileIndexController.class);
	

	@Autowired
	private SysUserManager userManager;

	@Autowired
	private HttpSession session;
    
    @Value("#{sysProp['system.title']}")
    private String systemTitle;
    
    @Value("#{sysProp['system.host.unit']}")
    private String systemHostUnit;
	/**
	 * @category 跳转九宫格首页
	 * @date 2015年6月12日
	 * @return
	 */
	@RequestMapping("/mobile/index")
	public String login(HttpServletRequest request) {
		Map<String,Object> userMap = (Map<String, Object>) session.getAttribute(Constants.USERINFO);
		if (userMap != null) {
			request.setAttribute("user", userMap);
		}
		request.setAttribute("systemHostUnit", systemHostUnit);
		request.setAttribute("systemTitle", systemTitle);
		return "/mobile/index";
	}
	
	@RequestMapping("/mobile/indexJKRJ")
	public String indexJKRJ(HttpServletRequest request) {
		request.setAttribute("systemHostUnit", systemHostUnit);
		request.setAttribute("systemTitle", systemTitle);
		return "/mobile/indexJKRJ";
	}
	
	@RequestMapping("/mobile/indexJKGL")
	public String indexJKKT(HttpServletRequest request) {
		request.setAttribute("systemHostUnit", systemHostUnit);
		request.setAttribute("systemTitle", systemTitle);
		return "/mobile/indexJKGL";
	}
	
	@RequestMapping("/mobile/indexJKKT")
	public String indexJKGL(HttpServletRequest request) {
		request.setAttribute("systemHostUnit", systemHostUnit);
		request.setAttribute("systemTitle", systemTitle);
		return "/mobile/indexJKKT";
	}
	
	@RequestMapping("/mobile/indexMYZQ")
	public String indexMYZQ(HttpServletRequest request) {
		request.setAttribute("systemHostUnit", systemHostUnit);
		request.setAttribute("systemTitle", systemTitle);
		return "/mobile/indexMYZQ";
	}
	
	@RequestMapping("/mobile/indexETJKSC")
	public String indexETJKSC(HttpServletRequest request) {
		request.setAttribute("systemHostUnit", systemHostUnit);
		request.setAttribute("systemTitle", systemTitle);
		return "/mobile/indexETJKSC";
	}
	
	@RequestMapping("/mobile/indexYCQJS")
	public String indexYCQJS(HttpServletRequest request) {
		request.setAttribute("systemHostUnit", systemHostUnit);
		request.setAttribute("systemTitle", systemTitle);
		return "/mobile/indexYCQJS";
	}
	
	@RequestMapping("/mobile/indexYFKT")
	public String indexYFKT(HttpServletRequest request) {
		request.setAttribute("systemHostUnit", systemHostUnit);
		request.setAttribute("systemTitle", systemTitle);
		return "/mobile/indexYFKT";
	}
	
	@RequestMapping("/mobile/indexJKSC")
	public String indexJKSC(HttpServletRequest request) {
		request.setAttribute("systemHostUnit", systemHostUnit);
		request.setAttribute("systemTitle", systemTitle);
		return "/mobile/indexJKSC";
	}
}
